/*
 * Region.java
 *
 * Created on 28 March 2007, 20:29
 *
 * 
 */

package rxtokenizer;

/**
 *
 * @author Ruslan Fayzrakhmanov
 */
public class Region {

    public Region(int start, int end, IDocument document) {
        this.start = start;
        this.end = end;
        this.document = document;
    }
    
    public final int getStart() {
        return start;
    }
    
    public final int getEnd() {
        return end;
    }
    
    public final IDocument getDocument() {
        return document;
    }
    
    public final int getLength() {
        return end - start;
    }
    
    protected String getValue() {
	return document.getText(this);
    }
    
    public String toString() {
        return "["+start+", "+end+"]";
    }
    
    private int start = 0;
    private int end = 0;
    private IDocument document = null;
    
}
